package org.ezplatform.office.forum.dao;

import java.util.List;

import org.ezplatform.core.dao.jpa.JpaBaseDao;
import org.ezplatform.office.forum.entity.ForumLabel;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 *  论坛标签dao
 * 2019年11月2日17:40:59
 * @author Administrator
 *
 */
@Repository
public interface ForumLabelDao extends JpaBaseDao<ForumLabel, String> {
	
	@Modifying
	@Query(nativeQuery = true, value = "update oa_forum_label set is_delete = ?1 where id in (?2)")
	int setLabelDel(int isDelete,List<String> list);
	
	@Query(" from ForumLabel where corpId = ?1 and  isDelete = 0 and status = 1  ORDER BY createdDate DESC ")
	List<ForumLabel> getCorpLable(String corpId);

	@Query(" from ForumLabel where name = ?1 and corpId = ?2 and isDelete = 0 ")
	List<ForumLabel> checkLabel(String name, String corpId);

	@Query(" from ForumLabel where id in (?1)  ")
	List<ForumLabel> getLabel(List<String> idList);

}
